Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update fixtures #17

Merged
merged 1 commit into from
Nov 4, 2024
Merged

fix: update fixtures #17

merged 1 commit into from
Nov 4, 2024

Conversation

Thoralf-M
Copy link
Member

@Thoralf-M Thoralf-M commented Oct 30, 2024

Update fixtures for transaction_fixtures(), WORMHOLE_PYTH_TRANSACTION and AUTHENTICATOR_STATE_UPDATE are removed as we don't have them currently in our networks

Fixes iotaledger/iota#3475

The block ids to get the raw_transaction from I got using the TS SDK

import { IotaClient } from '@iota/iota-sdk/client';

const client = new IotaClient({
    url: 'http://127.0.0.1:9000',
});

let cursor;
let txsToFind = 5;
(async () => {
    searchLoop: while (true) {
        const txBlocksPage = await client.queryTransactionBlocks({
            cursor,
            options: {
                showEffects: false,
                showInput: true,
                showObjectChanges: false
            }
        })
        for (const txBlock of txBlocksPage.data) {
            if (txBlock.transaction != null
                // Comment based on what kind is wanted 
                // @ts-ignore
                && txBlock.transaction.data.transaction.kind != 'ConsensusCommitPrologueV1'
                && txBlock.transaction.data.transaction.kind != 'RandomnessStateUpdate'
                && txBlock.transaction.data.transaction.kind != 'EndOfEpochTransaction'
                // && txBlock.transaction.data.transaction.kind != 'AuthenticatorStateUpdate'
            ) {
                // Cleanup output
                try {
                    // Temp fix to not spam the console output as the raw effects are currently always included https://github.com/iotaledger/iota/issues/2488
                    delete txBlock.rawEffects
                    // @ts-ignore
                    delete txBlock.transaction.data.messageVersion
                    // @ts-ignore
                    delete txBlock.transaction.data.transaction.inputs[0].type
                    // @ts-ignore
                    delete txBlock.transaction.data.transaction.inputs[0].valueType
                    // @ts-ignore
                    delete txBlock.transaction.data.gasData.payment[0].digest
                    // @ts-ignore
                    delete txBlock.transaction.data.sender
                    // @ts-ignore
                    delete txBlock.transaction.txSignatures
                } catch (error) { }

                console.log(JSON.stringify(txBlock, (k, v) => {
                    if (v instanceof Array)
                        return JSON.stringify(v);
                    return v;
                }, 2).replace(/\\/g, ''))
                // console.log(txBlock)
                txsToFind -= 1;
                if (txsToFind == 0) {
                    break searchLoop
                }
            }
        }
        cursor = txBlocksPage.nextCursor;
    }
})()

@Thoralf-M Thoralf-M merged commit 9613695 into main Nov 4, 2024
6 checks passed
@Thoralf-M Thoralf-M deleted the feat/update-fixtures branch November 4, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update fn transaction_fixtures() in iota-rust-sdk
2 participants